/*
 * Copyright (c) 2005 -2008 Reliable Source, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Mozilla Public License v.1.1,
 * BSD, and Eclipse Public License v1.0 which accompanies this
 * distribution and is available at:
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 * 		http://www.opensource.org/licenses/bsd-license.php
 * 		http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * Contributors:
 *     IBM Corporation	     -  http://ibm.com
 *     	- initial API and implementation
 *
 *     Reliable Source, Inc. - http://reliablesource.org
 *
 */
package org.reliablesource.client.ui.adapters;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.reliablesource.model.core.IReliableElement;

/**
 *
 *   ReliableElementPropertySourceAdapter.java
 *   Created on: Apr 25, 2006
 *   
 *   @author Dennis Park 
 *      <a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
 *
 */

public class ReliableElementPropertySourceAdapter implements IPropertySource{
	final protected List descriptorsList;

	final protected List mergedDescriptorsList;
	final private IReliableElement element;
	
	public ReliableElementPropertySourceAdapter(final IReliableElement _element){
		super();
		descriptorsList = new ArrayList();
		mergedDescriptorsList = new ArrayList();
		element = _element;
	}
	
	public Object getEditableValue() {
		return null;
	}

	public IPropertyDescriptor[] getPropertyDescriptors() {
		
//		PropertyDescriptor pd = new PropertyDescriptor(IPrismScreen.CURSOR_START_PT, "Animation Start Point:");
//		pd.setLabelProvider(new ILabelProvider(){
//			
//			public Image getImage(Object element) {
//				return null;
//			}
//
//			public String getText(Object element) {
//				StringBuffer buffer = new StringBuffer();
//				Point p = (Point)element;				
//				return buffer.append("(" + p.x + "," + p.y + ")").toString();
//			}
//
//			public void addListener(ILabelProviderListener listener) {
//			}
//
//			public void dispose() {
//			}
//
//			public boolean isLabelProperty(Object element, String property) {
//				return false;
//			}
//
//			public void removeListener(ILabelProviderListener listener) {
//			}
//			
//		});
		
		return new IPropertyDescriptor[] {
//		        pd,  
				new PropertyDescriptor(IReliableElement.NAME, "Name:") };
	}

	public Object getPropertyValue(Object propertyId) {
	    
	        
//		if (IPrismScreen.IMAGE_PATH.equals(propertyId))
//			return node.getImageFilePath() + node.getName() + "." + node.getImageFileType();
//		else if(IPrismScreen.CURSOR_START_PT.equals(propertyId))
//			return node.getPointerStart();
//		else if(IPrismScreen.CURSOR_PTS.equals(propertyId))
//			return node.getPathLocationsList();
//		else if(IPrismScreen.ANNOTATIONS.equals(propertyId))
//			return node.getAnnotationsList();		
		return null;
	}

	public boolean isPropertySet(Object id) {
		return false;
	}

	public void resetPropertyValue(Object id) {
		
	}

	public void setPropertyValue(Object id, Object value) {
		
	}

}
